home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Aliases.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  6.3 KB  |  202 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Aliases.a
  3. ;
  4. ;    Contains:    Alias Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1989-1997, 1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  19. __ALIASES__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  25.     include 'AppleTalk.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.  
  31.  
  32. rAliasType                        EQU        'alis'                ; Aliases are stored as resources of this type 
  33.  
  34.                                                             ; define alias resolution action rules mask 
  35. kARMMountVol                    EQU        $00000001            ; mount the volume automatically 
  36. kARMNoUI                        EQU        $00000002            ; no user interface allowed during resolution 
  37. kARMMultVols                    EQU        $00000008            ; search on multiple volumes 
  38. kARMSearch                        EQU        $00000100            ; search quickly 
  39. kARMSearchMore                    EQU        $00000200            ; search further 
  40. kARMSearchRelFirst                EQU        $00000400            ; search target on a relative path first 
  41.  
  42.                                                             ; define alias record information types 
  43. asiZoneName                        EQU        -3                    ; get zone name 
  44. asiServerName                    EQU        -2                    ; get server name 
  45. asiVolumeName                    EQU        -1                    ; get volume name 
  46. asiAliasName                    EQU        0                    ; get aliased file/folder/volume name 
  47. asiParentName                    EQU        1                    ; get parent folder name 
  48. ;  define the alias record that will be the blackbox for the caller 
  49. AliasRecord                RECORD 0
  50. userType                 ds.l    1                ; offset: $0 (0)        ;  appl stored type like creator type 
  51. aliasSize                 ds.w    1                ; offset: $4 (4)        ;  alias record size in bytes, for appl usage 
  52. sizeof                     EQU *                    ; size:   $6 (6)
  53.                         ENDR
  54. ; typedef struct AliasRecord *            AliasPtr
  55.  
  56. ; typedef AliasPtr *                    AliasHandle
  57.  
  58. ;  alias record information type 
  59. ; typedef short                         AliasInfoType
  60.  
  61. ;   create a new alias between fromFile-target and return alias record handle  
  62. ;
  63. ; pascal OSErr NewAlias(ConstFSSpecPtr fromFile, const FSSpec *target, AliasHandle *alias)
  64. ;
  65.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  66.         Macro
  67.         _NewAlias
  68.             moveq               #2,D0
  69.             dc.w                $A823
  70.         EndM
  71.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  72.         IMPORT_CFM_FUNCTION NewAlias
  73.     ENDIF
  74.  
  75. ;  create a minimal new alias for a target and return alias record handle 
  76. ;
  77. ; pascal OSErr NewAliasMinimal(const FSSpec *target, AliasHandle *alias)
  78. ;
  79.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  80.         Macro
  81.         _NewAliasMinimal
  82.             moveq               #8,D0
  83.             dc.w                $A823
  84.         EndM
  85.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  86.         IMPORT_CFM_FUNCTION NewAliasMinimal
  87.     ENDIF
  88.  
  89. ;  create a minimal new alias from a target fullpath (optional zone and server name) and return alias record handle  
  90. ;
  91. ; pascal OSErr NewAliasMinimalFromFullPath(short fullPathLength, const void *fullPath, ConstStr32Param zoneName, ConstStr31Param serverName, AliasHandle *alias)
  92. ;
  93.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  94.         Macro
  95.         _NewAliasMinimalFromFullPath
  96.             moveq               #9,D0
  97.             dc.w                $A823
  98.         EndM
  99.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  100.         IMPORT_CFM_FUNCTION NewAliasMinimalFromFullPath
  101.     ENDIF
  102.  
  103. ;  given an alias handle and fromFile, resolve the alias, update the alias record and return aliased filename and wasChanged flag. 
  104. ;
  105. ; pascal OSErr ResolveAlias(ConstFSSpecPtr fromFile, AliasHandle alias, FSSpec *target, Boolean *wasChanged)
  106. ;
  107.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  108.         Macro
  109.         _ResolveAlias
  110.             moveq               #3,D0
  111.             dc.w                $A823
  112.         EndM
  113.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  114.         IMPORT_CFM_FUNCTION ResolveAlias
  115.     ENDIF
  116.  
  117. ;  given an alias handle and an index specifying requested alias information type, return the information from alias record as a string. 
  118. ;
  119. ; pascal OSErr GetAliasInfo(AliasHandle alias, AliasInfoType index, Str63 theString)
  120. ;
  121.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  122.         Macro
  123.         _GetAliasInfo
  124.             moveq               #7,D0
  125.             dc.w                $A823
  126.         EndM
  127.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  128.         IMPORT_CFM_FUNCTION GetAliasInfo
  129.     ENDIF
  130.  
  131. ;  
  132. ;  Given a file spec, return target file spec if input file spec is an alias.
  133. ;  It resolves the entire alias chain or one step of the chain.  It returns
  134. ;  info about whether the target is a folder or file; and whether the input
  135. ;  file spec was an alias or not. 
  136. ;
  137.  
  138. ;
  139. ; pascal OSErr ResolveAliasFile(FSSpec *theSpec, Boolean resolveAliasChains, Boolean *targetIsFolder, Boolean *wasAliased)
  140. ;
  141.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  142.         Macro
  143.         _ResolveAliasFile
  144.             moveq               #12,D0
  145.             dc.w                $A823
  146.         EndM
  147.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  148.         IMPORT_CFM_FUNCTION ResolveAliasFile
  149.     ENDIF
  150.  
  151. ;
  152. ; pascal OSErr FollowFinderAlias(ConstFSSpecPtr fromFile, AliasHandle alias, Boolean logon, FSSpec *target, Boolean *wasChanged)
  153. ;
  154.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  155.         Macro
  156.         _FollowFinderAlias
  157.             moveq               #15,D0
  158.             dc.w                $A823
  159.         EndM
  160.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  161.         IMPORT_CFM_FUNCTION FollowFinderAlias
  162.     ENDIF
  163.  
  164. ;  
  165. ;   Low Level Routines 
  166. ;
  167.  
  168. ;  given a fromFile-target pair and an alias handle, update the lias record pointed to by alias handle to represent target as the new alias. 
  169. ;
  170. ; pascal OSErr UpdateAlias(ConstFSSpecPtr fromFile, const FSSpec *target, AliasHandle alias, Boolean *wasChanged)
  171. ;
  172.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  173.         Macro
  174.         _UpdateAlias
  175.             moveq               #6,D0
  176.             dc.w                $A823
  177.         EndM
  178.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  179.         IMPORT_CFM_FUNCTION UpdateAlias
  180.     ENDIF
  181.  
  182.  
  183.  
  184. ;   Given an alias handle and fromFile, match the alias and return aliased filename(s) and needsUpdate flag 
  185. ;
  186. ; pascal OSErr MatchAlias(ConstFSSpecPtr fromFile, unsigned long rulesMask, AliasHandle alias, short *aliasCount, FSSpecArrayPtr aliasList, Boolean *needsUpdate, AliasFilterUPP aliasFilter, void *yourDataPtr)
  187. ;
  188.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  189.         Macro
  190.         _MatchAlias
  191.             moveq               #5,D0
  192.             dc.w                $A823
  193.         EndM
  194.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  195.         IMPORT_CFM_FUNCTION MatchAlias
  196.     ENDIF
  197.  
  198.  
  199.  
  200.     ENDIF ; __ALIASES__ 
  201.  
  202.